export const readOnly = (obj: Object) => Object.freeze(obj);

export const parsePath = (path: string) => {
  // search/path/hash
  const result: any = {};
  if (path) {
    const hashIndex = path.indexOf('#');
    if (hashIndex >= 0) {
      result.hash = path.substr(hashIndex);
    }
  }

  return result;
}